/*
    This file is part of ETP-Basic Compiler, a cross compiler for TI by Onur Celebi 2005-2007.

    ETP-Basic Compiler is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    ETP-Basic Compiler is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "asmz80Coder.h"

char* ImageOpz80[]={
	"???",
	"LD",
	"ADD",
	"SUB",
	"JR",
	"RTS",
};
/*typedef enum InsOpEnumz80{
	OPB,		// unknown opbin
	LOAD,
	ADD,
	SUB,
	JR,
	RTS,
};*/


asmz80Coder::asmz80Coder(void){
	mStream=NULL;
	generatedCode=NULL;
	lastAdded=NULL;
}
asmz80Coder::~asmz80Coder(void){
}

void asmz80Coder::AfficherLeDebut(){
	(*mStream) << ";This code is automatically generated by ETP-Basic compiler\n";
	(*mStream) << "\t.nolist\n\t#include \"ion.inc\"\n";
    (*mStream) << "\t.list\n\n\n";
	(*mStream) << "#ifdef TI83P\n";
    (*mStream) << "\t.org    progstart-2\n";
    (*mStream) << "\t.db     $BB,6D\n";
	(*mStream) << "#else\n";
	(*mStream) << "\t.org    progstart\n";
	(*mStream) << "#endif\n";
    (*mStream) << "\tret\n";
	(*mStream) << "\tjr      nc,lblStart\t\t;jumps to the label lblstart\n";
	(*mStream) << ".db     \"MadeWithETP\",0\t\t;The title displayed by ION\n\n\n\n";

	(*mStream) << "lblStart:\n\n";
}


void asmz80Coder::AfficherLaFin(){
	(*mStream) << ".end\n.end\n";

}


